package com.gzbit.calculator.normal.bll;

//完整业务逻辑类
public class Operation {
    public int getResult(int numberA, int numberB, String operator) throws Exception {
        int result;
        //业务逻辑代码
        switch (operator) {
            case "+":
                result = numberA + numberB;
                break;
            case "-":
                result = numberA - numberB;
                break;
            case "*":
                result = numberA * numberB;
                break;
            default:
                throw new Exception("输入的运算符号不合法！");
        }
        return result;
    }
}
